package calorie.com.calorie.util;

import java.text.DecimalFormat;

public class NumberFormatUtils {
    public static String keepTwoDecimal(String s){
        if (s.contains(".")){
            int index = s.indexOf(".");
            if (s.length()-index-1>2){
                DecimalFormat df=new DecimalFormat("#0.00");
                return df.format(Double.valueOf(s));
            }
        }
        return s;
    }
}
